Returns or sets the direction in which the focus is moved when the user presses the ENTER key and the MoveAfterReturn property is set to True. Read/write XlDirection.
XlDirection can be one of these XlDirection constants. |
xlDown |
xlToLeft |
xlToRight |
xlUp |
expression.MoveAfterReturnDirection
expression Required. An expression that returns a Spreadsheet object.
This example causes the cell to the right of the active cell to be selected after the user presses the ENTER key.
Sub MoveAfterEnter()
Dim ssConstants
Set ssConstants = Spreadsheet1.Constants
' Enable the MoveAfterReturn property.
Spreadsheet1.MoveAfterReturn = True
' Move the cursor one cell to the right when
' the user presses ENTER.
Spreadsheet1.MoveAfterReturnDirection = xlToRight
End Sub